package com.idanchuang.count;

import com.idanchuang.component.base.exception.core.ExType;
import com.idanchuang.component.base.exception.core.IErrorEnum;

/**
 * 错误码
 * @author richard_yyf
 */
public enum IErrorCode implements IErrorEnum {

    /**
     * 自定义错误码
     */
    CONFIG_NOT_FOUND(ExType.BUSINESS_ERROR, 1000, "对应业务场景配置不存在: {}"),
    JSON_ERROR(ExType.BUSINESS_ERROR, 1001, "json 处理出错, {}"),

    ;

    IErrorCode(ExType exType, int code, String msg) {
        this.exType = exType;
        this.code = code;
        this.msg = msg;
    }

    private ExType exType;

    private int code;

    private String msg;

    @Override
    public ExType getExType() {
        return exType;
    }

    public void setExType(ExType exType) {
        this.exType = exType;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
